function btn_show_report(p_fuseaction){
	if (verify(document.forms(0))){
		var v_url = '';
		var v_exporttype = document.forms(0).hdn_exporttype.value;
		var v_reporttype = document.forms(0).hdn_reporttype_filter.value;
		var v_list_xml_tag = document.forms(0).hdn_list_xml_tag.value;
		var v_list_xml_value = document.forms(0).hdn_list_xml_value.value;
		v_url = 'index.php?fuseaction=' + p_fuseaction;
		v_url = v_url + '&rad_exporttype=' + v_exporttype;
		v_url = v_url + '&hdn_reporttype_filter=' + v_reporttype;
		v_url = v_url + '&hdn_list_xml_tag=' + v_list_xml_tag;
		v_url = v_url + '&hdn_list_xml_value=' + v_list_xml_value;
		v_url = v_url + '&modal_dialog_mode=1';
		open_me(v_url, 0, 1, 1,0, 1, 0, 0, 0, 0, 480, 640, 0, 0);
	}
}
function btn_rad_onclick(p_rad_obj,p_hdn_obj){
	p_hdn_obj.value = p_rad_obj.value;
}

function display_childselectbox_by_fk(parent_id,child_obj){
	var k = 1;
	var len = child_obj.arr_parent_id.length;
	child_obj.length=0;
	child_obj.options[0] = new Option("--Chọn loại báo cáo--");
	child_obj.options[0].value = "";

	for (i=0; i<len; i++){
		if (child_obj.arr_parent_id[i] == parent_id){// || parent_id ==""){
			child_obj.options[k] = new Option(child_obj.arr_text[i]);
			child_obj.options[k].value = child_obj.arr_id[i];
			k=k+1;
		}		
		if (k>0) child_obj.options[0].selected;
	}
}
function onchange_submit(obj_sel_type,obj_hdn_type,p_fuseation){
	obj_hdn_type.value = obj_sel_type.value;
	v_fuseation = p_fuseation;
	if (v_fuseation != ""){
		document.forms(0).fuseaction.value = v_fuseation;
		document.forms(0).submit();
	}
}
function check_value_in_form(){
}
function set_input(){
	//alert("Da load xong form");
}
function save_hidden_list_item_id(p_hdn_list,p_chk_obj){
	if (checkbox_value_to_list(p_chk_obj,",")!=""){
		p_hdn_list.value = checkbox_value_to_list(p_chk_obj,",");
		//alert(p_hdn_list.value);
	}
}
///Luu lai danh sach cac the va cac gia tri co trong form
function save_list_onclick(f,hdn_obj_tag,hdn_obj_value){
	var list_tag = "";
	var list_value = "";
	var v_temp = "";
	var v_value = "";
	_save_checkbox_value_to_textbox_obj(document.all.chk_item_id,',');
	for (i=0;i<f.length;i++){
		var e=f.elements[i];
		if (e.value==""||e.value==null){
			v_value=" ";
		}else{
			v_value=e.value;
		}
		
		if (e.xml_tag_in_db &&(e.type!='radio' && e.type!='checkbox')){
			list_tag = list_append(list_tag,e.xml_tag_in_db,_SUB_LIST_DELIMITOR);
			list_value = list_append(list_value,v_value,_SUB_LIST_DELIMITOR);
		}
		if (e.xml_tag_in_db &&(e.type=='radio' || e.type=='checkbox')){
			list_tag = list_append(list_tag,e.xml_tag_in_db,_SUB_LIST_DELIMITOR);
			if (e.checked==true){
				v_temp="true";
			}else{
				v_temp="false";
			}
			list_value = list_append(list_value,v_temp,_SUB_LIST_DELIMITOR);
		}
		
	}
	if (hdn_obj_tag.value!=null && hdn_obj_value.value!=null){
		hdn_obj_tag.value = list_tag;
		hdn_obj_value.value = list_value;
	}
}
//Chuyen toi url
function goto_url(p_url,p_open_new_win)
{
	if (p_open_new_win==3)
		open_me(p_url, 0, 1, 1,0, 1, 0, 0, 0, 0, 480, 640, 0, 0);
	else{
		//document.parentWindow.location = p_url;	
		//alert (document.location);
		if (p_open_new_win==2)
			window.top.location = p_url;
		else{
			window.location = p_url;
		}
	}
}
//==============================================================================================================
// open new window with some value
function open_me(url, vStatus, vResizeable, vScrollbars, vToolbar,vMenubar, vLocation, vFullscreen, vTitlebar, vCentered, vHeight, vWidth, vTop, vLeft)	 
{
	winDef = '';
	winDef = winDef.concat('status=').concat((vStatus) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('resizable=').concat((vResizeable) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('scrollbars=').concat((vScrollbars) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('toolbar=').concat((vToolbar) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('menubar=').concat((vMenubar) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('location=').concat((vLocation) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('fullscreen=').concat((vFullscreen) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('titlebar=').concat((vTitlebar) ? 'yes' : 'no').concat(',');
	winDef = winDef.concat('height=').concat(vHeight).concat(',');
	winDef = winDef.concat('width=').concat(vWidth).concat(',');

	if (vCentered)	{
		winDef = winDef.concat('top=').concat((screen.height - vHeight)/2).concat(',');
		winDef = winDef.concat('left=').concat((screen.width - vWidth)/2);
	}
	else	{
		winDef = winDef.concat('top=').concat(vTop).concat(',');
		winDef = winDef.concat('left=').concat(vLeft);
	}
	open(url, '_blank', winDef);
}